viewport: Set frame styleclass when getting border size during size allocation
authorAlexander Larsson <alexl@redhat.com>
Thu, 9 Feb 2012 15:36:46 +0000 (16:36 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 9 Feb 2012 15:39:23 +0000 (16:39 +0100)
Without this you don't get the right border/padding for widget->window
and the border shows up under the scrolled contents.

gtk/gtkviewport.c

index 048d0f63cf7020e33b1d2062c023d8f085df3af3..73238ee8b8e902fc90a9d5cad037fc17cec7d191 100644 (file)
@@ -328,9 +328,14 @@ viewport_get_view_allocation (GtkViewport   *viewport,
 
   context = gtk_widget_get_style_context (widget);
   state = gtk_widget_get_state_flags (widget);
+  gtk_style_context_save (context);
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
+
   gtk_style_context_get_padding (context, state, &padding);
   gtk_style_context_get_border (context, state, &border);
 
+  gtk_style_context_restore (context);
+
   if (priv->shadow_type != GTK_SHADOW_NONE)
     {
       view_allocation->x = border.left;